- 
                Notifications
    
You must be signed in to change notification settings  - Fork 101
 
🆕 Add GrandQC tissue detection model #965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev-define-engines-abc
Are you sure you want to change the base?
Conversation
          Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@                    Coverage Diff                     @@
##           dev-define-engines-abc     #965      +/-   ##
==========================================================
+ Coverage                   94.72%   94.74%   +0.02%     
==========================================================
  Files                          73       74       +1     
  Lines                        9235     9276      +41     
  Branches                     1208     1208              
==========================================================
+ Hits                         8748     8789      +41     
  Misses                        452      452              
  Partials                       35       35              ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR integrates the GrandQC tissue detection model into TIAToolBox, adding a UNet++ based tissue segmentation capability trained at 10 microns per pixel resolution. The implementation leverages the segmentation-models-pytorch library to avoid reimplementing the UNet++ architecture.
- Adds GrandQC tissue detection model architecture and pretrained weights
 - Integrates model with existing tissue masking functionality
 - Adds comprehensive test coverage and example usage
 
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description | 
|---|---|
| tiatoolbox/models/architecture/grandqc.py | Defines the TissueDetectionModel class with UNet++ architecture and custom preprocessing/postprocessing | 
| tiatoolbox/data/pretrained_model.yaml | Adds GrandQC model configuration and fixes IOConfig class references across multiple models | 
| tests/models/test_arch_grandqc.py | Implements unit tests for model creation, weight loading, and inference | 
| requirements/requirements.txt | Adds segmentation-models-pytorch dependency | 
| tiatoolbox/wsicore/wsireader.py | Integrates GrandQC masker into tissue_mask method with 10mpp resolution handling | 
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 
               | 
          ||
| @staticmethod | ||
| def preproc(image: np.ndarray) -> np.ndarray: | ||
| """Apply jpg compression then ImageNet normalise.""" | 
    
      
    
      Copilot
AI
    
    
    
      Oct 31, 2025 
    
  
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'normalise' to 'normalize' for consistency with American English spelling used elsewhere in the codebase.
| """Apply jpg compression then ImageNet normalise.""" | |
| """Apply jpg compression then ImageNet normalize.""" | 
| 
               | 
          ||
| @staticmethod | ||
| def preproc(image: np.ndarray) -> np.ndarray: | ||
| """Apply jpg compression then ImageNet normalise.""" | 
    
      
    
      Copilot
AI
    
    
    
      Oct 31, 2025 
    
  
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The preproc docstring lacks parameter and return type documentation. Consider adding a complete docstring with Args and Returns sections following the pattern used in other models like HoVerNet and MicroNet.
| """Apply jpg compression then ImageNet normalise.""" | |
| """Apply JPEG compression and ImageNet normalization to the input image. | |
| Args: | |
| image (np.ndarray): | |
| Input image as a NumPy array (H, W, C) in uint8 format. | |
| Returns: | |
| np.ndarray: | |
| The preprocessed image as a float32 NumPy array, normalized using ImageNet mean and std. | |
| """ | 
This PR adds GrandQC tissue detection (Unet++) model to TIAToolBox models. GrandQC Original Github.
Tasks
pretrained_model.yamlrequirements.txt